package com.cz.video.website.service;

import com.cz.video.common.core.domain.PageQuery;
import com.cz.video.common.core.page.TableDataInfo;
import com.cz.video.common.vod.dto.VodCallbackEvent;
import com.cz.video.website.domain.WebsiteVideo;
import com.cz.video.website.domain.bo.WebsiteVideoBo;
import com.cz.video.website.domain.vo.WebsiteVideoVo;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.List;

/**
 * <p>
 * 电影视频表 服务类
 * </p>
 *
 * @author 洪圆胜
 * @since 2023-10-15
 */
public interface IWebsiteVideoService{


    int addVideo(WebsiteVideoBo websiteVideo);

    int update(WebsiteVideoBo websiteVideo);


    int deleteSelfById(Long[] ids);

    WebsiteVideoVo getById(Long id);

    TableDataInfo<WebsiteVideoVo> page(WebsiteVideoBo websiteVideo, PageQuery pageQuery);

    /**
     * 更新视频上传状态
     * @param video
     * @return
     */
    int updateUploadStatus(WebsiteVideo video);

    /**
     * 根据vid查询
     * @param vid
     * @return
     */
    WebsiteVideo getByVid(String vid);

    /**
     * 刷新视频元数据
     * @param vodCallbackEvent
     */
    void refreshMetaInfo(VodCallbackEvent vodCallbackEvent);

    /**
     * 审核视频
     * @param videoId 视频id
     * @param isPass 是否通过
     * @param auditResult 审核结果
     * @return
     */
    int audit(Long videoId, Boolean isPass,String auditResult);

    /**
     * 点赞视频
     * @param sourceId
     * @return
     */
    int like(Long sourceId);

    /**
     * 更新是否上下架
     * @param videoId
     * @param isOnline
     * @return
     */
    int updateStatus(Long videoId, Boolean isOnline);


    @Schema(description = "设置封面")
    public void setCover(List<WebsiteVideoVo> rows);

    /**
     * 记录点击
     *
     * @param userId
     * @param websiteVideo
     * @return
     */
    boolean recordClick(Long userId, WebsiteVideoVo websiteVideo);

    /**
     * 获取热门课程
     * @return
     */
    TableDataInfo<WebsiteVideoVo> hotPage(PageQuery pageQuery);

    /**
     * 获取推荐的视频
     * @param videoId
     * @param pageQuery
     * @return
     */
    TableDataInfo<WebsiteVideoVo> pageRecommended(Long videoId, PageQuery pageQuery);
}
